package com.leaderment.timatt;

import java.nio.charset.StandardCharsets;

import org.apache.log4j.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;

@EnableDiscoveryClient
@SpringBootApplication
@MapperScan({"com.leaderment.timatt.mybatis.mapper"})
public class CrawlerExecutorApplication {
	
	static Logger logger=Logger.getLogger(CrawlerExecutorApplication.class);

    public static void main(String[] args) {
    	SpringApplication.run(CrawlerExecutorApplication.class, args);
    }
    
    @LoadBalanced
    @Bean
    RestTemplate restTemplate(){
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
        return restTemplate;
    }
}

